import request from '@/utils/request'
// 地产信息接口
// 查询地产信息列表
export function fetchBuildingList(data) {
  return request({
    url: '/estateManage/getBusinessRealEstateList',
    method: 'post',
    data,
  })
}
// 查询单个地产信息
export function fetchSingleBuilding(id) {
  return request({
    url: '/estateManage/getBusinessRealEstateInfo',
    method: 'get',
    params: { floorId: id },
  })
}
// 新增地产信息
export function createBuilding(data) {
  return request({
    url: '/estateManage/createBusinessRealEstateInfo',
    method: 'post',
    data,
  })
}
// /estateManage/updateBusinessRealEstateInfo
// 新增地产信息
export function updateBuilding(data) {
  return request({
    url: '/estateManage/updateBusinessRealEstateInfo',
    method: 'post',
    data,
  })
}
// 配置地产额外信息
export function setExtraInfo(data) {
  return request({
    url: '/estateManage/addBusinessRealEstateExtraInfo',
    method: 'post',
    data,
  })
}
// 配置地产额外信息
export function updateExtraInfo(data) {
  return request({
    url: '/estateManage/updateBusinessRealEstateExtraInfo',
    method: 'post',
    data,
  })
}
// 配置地产额外信息
export function getExtraInfo(id) {
  return request({
    url: '/estateManage/getBusinessRealEstateExtraInfo',
    method: 'get',
    params: { estateId: id },
  })
}
// 配置公建芯房树列表
export function setMapTree(data) {
  return request({
    url: '/estatePartMap/add',
    method: 'post',
    data,
  })
}

export function getAllHouse() {
  return request({
    url: '/realEstate/getBusinessHouseTypePreview',
    method: 'get',
  })
}
//驻场人员解绑
export function unbindEstate(data) {
  return request({
    url: '/userEstateMap/delete',
    method: 'post',
    data,
  })
}
//删除地产
export function deleteBuildingEstate(data) {
  return request({
    url: '/estateManage/deleteBusinessRealEstate',
    method: 'post',
    data,
  })
}
